﻿using System.Collections.Generic;

namespace Chimp.Core
{
    public class xTexture2DNode : ChimpFXNode
    {
        public xTexture2DNode()
            : base("Texture2DNode", EffectNodeType.EngineInput)
        {
            AddOut(EffectParameterType.Texture2D, "RGBA", "Texture2D RGBA Value");
            PropUVSet = 0;
        }

        public int PropUVSet { get; set; }

        public override void ProduceSegment(List<ChimpEffectPar> pars)
        {
            if (ChimpFX.PreCode.Contains("uniform sampler2D " + PropNodeName + ";"))
            {
                ChimpFX.InitCode("//You have defined two texture nodes with the same name.:" + PropNodeName);
            }
            else
            {
                ChimpFX.InitCode("uniform sampler2D " + PropNodeName + ";");
                //base.ProduceSegment(pars);
            }
        }

        public override ChimpFXNode CreateNew()
        {
            return new xTexture2DNode();
        }
    }
}